
<tr id="tp_item{php echo $kw}" class='tp_item'>
    <td valign='top'>
        {php echo $data_type_config[$data_type]}
    </td>
    <td valign='top'>

        {ifp 'diyform.temp.edit|diyform.add'}
        <input type="hidden" value="{php echo $data_type}" class="form-control" name="tp_type[{php echo $kw}]" />

        <input type="text" value="{if $flag=1 && $data_type==6}身份证{else}{php echo $v1['tp_name']}{/if}" class="form-control tp_name" name="tp_name[{php echo $kw}]" maxlength="10" placeholder='字段名' />
        {else}
        {if $flag=1 && $data_type==6}身份证{else}{php echo $v1['tp_name']}{/if}
        {/if}
    </td>
    <td>
        {ifp 'diyform.temp.edit|diyform.add'}
        <input type="checkbox" name="tp_must[{php echo $kw}]" value="1" {if $v1['tp_must']==1}checked{/if} >
        {else}
        {if $v1['tp_must']==1}是{else}否{/if}
        {/if}
    </td>

    <td>
        {if $data_type==0 ||  $data_type==1}
        {if $data_type==0}
            设置默认值&nbsp;
            {ifp 'diyform.temp.edit|diyform.add'}
            <select id="tp_is_default{php echo $kw}" name="tp_is_default[{php echo $kw}]" onchange="tp_change_default('{php echo $kw}')" class="form-control" style='width:100px;display: inline-block'>
                {loop $default_data_config $key $value}
                <option value="{$key}" {if $v1['tp_is_default']==$key}selected{/if}>{$value}</option>
                {/loop}
            </select>
            {else}
            {$default_data_config[$v1['tp_is_default']]}
            {/if}

            {ifp 'diyform.temp.edit|diyform.add'}
            <input type="text" id="tp_default{php echo $kw}" placeholder="请输入自定义默认值" value="{php echo $v1['tp_default']}"
                   class="form-control tp_default" name="tp_default[{php echo $kw}]"
                   style="width:150px;display:{if $v1['tp_is_default']==1}inline{else}none{/if};">
            {else}
            <p style="display:{if $v1['tp_is_default']==1}inline{else}none{/if};">{php echo $v1['tp_default']}</p>
            {/if}
            {/if}

            提示语&nbsp;
            {ifp 'diyform.temp.edit|diyform.add'}
            <input type="text" id="placeholder{php echo $kw}" placeholder="请输入提示语" value="{php echo $v1['placeholder']}"
                   class="form-control" name="placeholder[{php echo $kw}]"
                   style="width:150px;display:inline;">
            {else}
            {php echo $v1['placeholder']}
            {/if}

        {else if $data_type==5}

            最大数量&nbsp;
            {ifp 'diyform.temp.edit|diyform.add'}
            <select name="tp_max[{php echo $kw}]" class="form-control" style='width:120px;display: inline-block'>
                <option value="1" {if $v1['tp_max']==1 || !$v1['tp_max']}selected{/if}>1</option>
                <option value="2" {if $v1['tp_max']==2}selected{/if}>2</option>
                <option value="3" {if $v1['tp_max']==3}selected{/if}>3</option>
                <option value="4" {if $v1['tp_max']==4}selected{/if}>4</option>
                <option value="5" {if $v1['tp_max']==5}selected{/if}>5</option>
            </select>
            {else}
            {if empty($v1['tp_max'])}1{else}{$v1['tp_max']}{/if}
            {/if}

        {else if $data_type==7}

            设置默认&nbsp;
            {ifp 'diyform.temp.edit|diyform.add'}
            <select id="default_time_type{php echo $kw}" name="default_time_type[{php echo $kw}]" onchange="tp_change_default_time(this,'default_time{php echo $kw}')" class="form-control" style="width:167px;display:inline;">
                {loop $default_date_config $key $value}
                <option value="{$key}" {if $v1['default_time_type']==$key}selected{/if}>{$value}</option>
                {/loop}
            </select>
            <input type="text" id="default_time{php echo $kw}" name="default_time[{php echo $kw}]" placeholder="" value="{if !empty($v1['default_time'])}{php echo $v1['default_time']}{/if}" class="datetimepicker1 form-control" style="width:120px;display: {if $v1['default_time_type']==2}inline{else}none{/if};">
            {else}
            {$default_date_config[$v1['default_time_type']]} &nbsp;{if !empty($v1['default_time'])}{php echo $v1['default_time']}{/if}
            {/if}

        {else if ($data_type==2 || $data_type==3)}

            {ifp 'diyform.temp.edit|diyform.add'}
            <textarea class="form-control" name="tp_text[{php echo $kw}]" placeholder="一行一个选项" style="height: 120px;">{if !empty($v1['tp_text'])}{loop $v1['tp_text'] $k2 $v2}{php echo $v2."\n";}{/loop}{/if}</textarea>
            {else}
            {if !empty($v1['tp_text'])}{loop $v1['tp_text'] $k2 $v2}{php echo $v2."<br>";}{/loop}{/if}
            {/if}

        {else if $data_type==8}

            设置默认起始日期&nbsp;
            {ifp 'diyform.temp.edit|diyform.add'}
            <select id="default_btime_type{php echo $kw}" name="default_btime_type[{php echo $kw}]" onchange="tp_change_default_time(this,'default_btime{php echo $kw}')" class="form-control input-sm" style="width:120px;display:inline;">
                {loop $default_date_config $key $value}
                <option value="{$key}" {if $v1['default_btime_type']==$key}selected{/if}>{$value}</option>
                {/loop}
            </select>
            <input type="text" id="default_btime{php echo $kw}" name="default_btime[{php echo $kw}]" placeholder="" value="{if !empty($v1['default_etime'])}{php echo $v1['default_btime']}{/if}" class="datetimepicker1 form-control  input-sm" style="width:120px;display:{if $v1['default_btime_type']==2}inline{else}none{/if};margin-right: 25px;">
            {else}
            {$default_date_config[$v1['default_btime_type']]} &nbsp; {if !empty($v1['default_etime'])}{php echo $v1['default_btime']}{/if}
            {/if}
            <br/>

            设置默认结束日期&nbsp;
            {ifp 'diyform.temp.edit|diyform.add'}
            <select id="default_etime_type{php echo $kw}" name="default_etime_type[{php echo $kw}]" onchange="tp_change_default_time(this,'default_etime{php echo $kw}')" class="form-control  input-sm" style="width:120px;display:inline;">
                {loop $default_date_config $key $value}
                <option value="{$key}" {if $v1['default_etime_type']==$key}selected{/if}>{$value}</option>
                {/loop}
            </select>
            <input type="text" id="default_etime{php echo $kw}" name="default_etime[{php echo $kw}]" placeholder="" value="{if !empty($v1['default_etime'])}{php echo $v1['default_etime']}{/if}" class="datetimepicker1 form-control  input-sm" style="width:120px;display:{if $v1['default_etime_type']==2}inline{else}none{/if};">
            {else}
            {$default_date_config[$v1['default_etime_type']]} &nbsp; {if !empty($v1['default_etime'])}{php echo $v1['default_etime']}{/if}
            {/if}

        {else if $data_type==10}
            字段名2&nbsp;
            {ifp 'diyform.temp.edit|diyform.add'}
            <input type="text" id="tp_name2{php echo $kw}" placeholder="字段名2" value="{php echo $v1['tp_name2']}"
                   class="form-control" name="tp_name2[{php echo $kw}]"
                   style="width:150px;display:inline;">
            {else}
            {php echo $v1['tp_name2']}
            {/if}
        {/if}
    </td>


    <td>
        {ifp 'diyform.temp.edit|diyform.add'}
        <a onclick="$(this).closest('.tp_item').remove()" class="btn btn-danger btn-sm" href="javascript:void(0);"><i class="fa fa-remove"></i></a>
        {/if}
    </td>


</tr>
